package com.woniuxy.ams.service.impl;

import com.woniuxy.ams.dao.SelfAppraisalDao;
import com.woniuxy.ams.entity.*;
import com.woniuxy.ams.service.SelfAppraisalService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author susunxi
 * @version 1.0
 * @date 2021/12/14 17:41
 */
@Service
public class SelfAppraisalServiceImpl implements SelfAppraisalService {

    @Autowired(required = false)
    SelfAppraisalDao selfAppraisalDao;

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public int addUserSelfEvaluation(SelfAppraisal selfAppraisal) {
        return selfAppraisalDao.addUserSelfEvaluation(selfAppraisal);

    }

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public List<ExamineList> getAllInfo(int userId, int deptId, String status) {
        return selfAppraisalDao.getAllInfo(userId, deptId, status);
    }

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public List<SelfInfoShowData> getAllAssessed(User user) {
        return selfAppraisalDao.getAllAssessed(user);
    }

    @Override
    public String findUserAssessName(Integer integer) {
        return selfAppraisalDao.findUserAssessName(integer);
    }

    @Override
    public List<String> findCheckInfoName(Integer integer) {
        return selfAppraisalDao.findCheckInfoName(integer);
    }

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public int addSelfieInfo(String filePath, String selfEvaluation, int eid, int uid) {
        return selfAppraisalDao.addSelfieInfo(filePath, selfEvaluation, eid, uid);
    }

    @Override
    public List<SelfInfoShowData> showDetails(SelfInfoShowData selfInfoShowData) {
        return selfAppraisalDao.showDetails(selfInfoShowData);
    }
}
